3.224 \(\int \cot ^2(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=131 \[ \frac {(B+i A) (a+i a \tan (c+d x))^n \, _2F_1\left (1,n;n+1;\frac {1}{2} (i \tan (c+d x)+1)\right )}{2 d n}-\frac {(B+i A n) (a+i a \tan (c+d x))^n \, _2F_1(1,n;n+1;i \tan (c+d x)+1)}{d n}-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d} \]

[Out]

-A*cot(d*x+c)*(a+I*a*tan(d*x+c))^n/d+1/2*(I*A+B)*hypergeom([1, n],[1+n],1/2+1/2*I*tan(d*x+c))*(a+I*a*tan(d*x+c
))^n/d/n-(B+I*A*n)*hypergeom([1, n],[1+n],1+I*tan(d*x+c))*(a+I*a*tan(d*x+c))^n/d/n

________________________________________________________________________________________

Rubi [A]  time = 0.33, antiderivative size = 131, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3598, 3600, 3481, 68, 3599, 65} \[ \frac {(B+i A) (a+i a \tan (c+d x))^n \, _2F_1\left (1,n;n+1;\frac {1}{2} (i \tan (c+d x)+1)\right )}{2 d n}-\frac {(B+i A n) (a+i a \tan (c+d x))^n \, _2F_1(1,n;n+1;i \tan (c+d x)+1)}{d n}-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]

[Out]

-((A*Cot[c + d*x]*(a + I*a*Tan[c + d*x])^n)/d) + ((I*A + B)*Hypergeometric2F1[1, n, 1 + n, (1 + I*Tan[c + d*x]
)/2]*(a + I*a*Tan[c + d*x])^n)/(2*d*n) - ((B + I*A*n)*Hypergeometric2F1[1, n, 1 + n, 1 + I*Tan[c + d*x]]*(a +
I*a*Tan[c + d*x])^n)/(d*n)

Rule 65

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x)^(n + 1)*Hypergeometric2F1[-m, n +
 1, n + 2, 1 + (d*x)/c])/(d*(n + 1)*(-(d/(b*c)))^m), x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (Inte
gerQ[m] || GtQ[-(d/(b*c)), 0])

Rule 68

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((b*c - a*d)^n*(a + b*x)^(m + 1)*Hype
rgeometric2F1[-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b^(n + 1)*(m + 1)), x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 3481

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Dist[b/d, Subst[Int[(a + x)^(n - 1)/(a - x), x]
, x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 + b^2, 0]

Rule 3598

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((A*d - B*c)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(f
*(n + 1)*(c^2 + d^2)), x] - Dist[1/(a*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n
 + 1)*Simp[A*(b*d*m - a*c*(n + 1)) - B*(b*c*m + a*d*(n + 1)) - a*(B*c - A*d)*(m + n + 1)*Tan[e + f*x], x], x],
 x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[n, -1]

Rule 3599

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(b*B)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x
]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && EqQ[A*b + a*B,
 0]

Rule 3600

Int[(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)]))/((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(A*b + a*B)/(b*c + a*d), Int[(a + b*Tan[e + f*x])^m, x], x] - Dist[(B*c
 - A*d)/(b*c + a*d), Int[((a + b*Tan[e + f*x])^m*(a - b*Tan[e + f*x]))/(c + d*Tan[e + f*x]), x], x] /; FreeQ[{
a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[A*b + a*B, 0]

Rubi steps

\begin {align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d}+\frac {\int \cot (c+d x) (a+i a \tan (c+d x))^n (a (B+i A n)-a A (1-n) \tan (c+d x)) \, dx}{a}\\ &=-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d}+(-A+i B) \int (a+i a \tan (c+d x))^n \, dx+\frac {(B+i A n) \int \cot (c+d x) (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n \, dx}{a}\\ &=-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d}+\frac {(a (i A+B)) \operatorname {Subst}\left (\int \frac {(a+x)^{-1+n}}{a-x} \, dx,x,i a \tan (c+d x)\right )}{d}+\frac {(a (B+i A n)) \operatorname {Subst}\left (\int \frac {(a+i a x)^{-1+n}}{x} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {A \cot (c+d x) (a+i a \tan (c+d x))^n}{d}+\frac {(i A+B) \, _2F_1\left (1,n;1+n;\frac {1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^n}{2 d n}-\frac {(B+i A n) \, _2F_1(1,n;1+n;1+i \tan (c+d x)) (a+i a \tan (c+d x))^n}{d n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 47.03, size = 0, normalized size = 0.00 \[ \int \cot ^2(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]

[Out]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^n*(A + B*Tan[c + d*x]), x]

________________________________________________________________________________________

fricas [F]  time = 0.57, size = 0, normalized size = 0.00 \[ {\rm integral}\left (-\frac {{\left ({\left (A - i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, A e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

integral(-((A - I*B)*e^(4*I*d*x + 4*I*c) + 2*A*e^(2*I*d*x + 2*I*c) + A + I*B)*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I
*d*x + 2*I*c) + 1))^n/(e^(4*I*d*x + 4*I*c) - 2*e^(2*I*d*x + 2*I*c) + 1), x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)^n*cot(d*x + c)^2, x)

________________________________________________________________________________________

maple [F]  time = 4.44, size = 0, normalized size = 0.00 \[ \int \left (\cot ^{2}\left (d x +c \right )\right ) \left (a +i a \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)

[Out]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)^n*cot(d*x + c)^2, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int {\mathrm {cot}\left (c+d\,x\right )}^2\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^2*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^n,x)

[Out]

int(cot(c + d*x)^2*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^n, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \left (A + B \tan {\left (c + d x \right )}\right ) \cot ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**n*(A+B*tan(d*x+c)),x)

[Out]

Integral((I*a*(tan(c + d*x) - I))**n*(A + B*tan(c + d*x))*cot(c + d*x)**2, x)

________________________________________________________________________________________